{% macro warning(current=true, section) %}
  {% if section and section.extra.public_draft %}
    {% set public_draft = section.extra.public_draft %}
    {% set issue = public_draft / 1 %}
    {% if current %}
      <h1 class="warning draft-header">Draft Page</h1>
      <div>
        The page is still under development (Tracking Issue: <a href="https://github.com/AzurIce/ranim/issues/{{ issue }}">{{ issue }}</a>). This page and all pages under it will be hidden from search engines and menus!
      </div>
    {% else %}
      <h1 class="warning">This page is hidden because an ancestor is hidden</h1>
    {% endif %}
  {% elif section.components %}
    {% set next_path = section.components | slice(end=-1) | concat(with="_index.md") | join(sep="/") %}
    {{ public_draft::warning(current=false, section=get_section(path=next_path) ) }}
  {% endif %}
{% endmacro warning %}